<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>消息框 - 组件演示</title>
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
    <div class="container">
        <header class="header">
            <h1>🚀 openHarmony_Cordova_NutpiDesign</h1>
            <p class="subtitle">组件演示 - 消息框组件</p>
        </header>

        <nav class="demo-nav">
            <a href="../index.html" class="nav-back">← 返回首页</a>
        </nav>

        <main class="main-content">
            <section class="demo-section">
                <h2>💬 消息框演示</h2>
                
                <div class="demo-container">
                    <div class="demo-item">
                        <h3>信息消息</h3>
                        <button id="infoBtn" class="demo-btn">打开</button>
                    </div>

                    <div class="demo-item">
                        <h3>成功消息</h3>
                        <button id="successBtn" class="demo-btn">打开</button>
                    </div>

                    <div class="demo-item">
                        <h3>错误消息</h3>
                        <button id="errorBtn" class="demo-btn">打开</button>
                    </div>

                    <div class="demo-item">
                        <h3>警告消息</h3>
                        <button id="warningBtn" class="demo-btn">打开</button>
                    </div>

                    <div class="demo-item">
                        <h3>加载中</h3>
                        <button id="loadingBtn" class="demo-btn">打开</button>
                    </div>

                    <div class="demo-item">
                        <h3>多条消息</h3>
                        <button id="multiBtn" class="demo-btn">打开</button>
                    </div>
                </div>
            </section>

            <section class="demo-section">
                <h2>使用代码</h2>
                <pre><code>// 消息框组件
const message = new Message({
    content: '这是一条消息',
    type: 'success',
    duration: 3000
});</code></pre>
            </section>
        </main>

        <footer class="footer">
            <p>&copy; 2025 OpenHarmony 三方库适配中心 | MIT License</p>
        </footer>
    </div>

    <script>
        document.getElementById('infoBtn').addEventListener('click', () => {
            alert('信息消息：已加载新数据');
        });

        document.getElementById('successBtn').addEventListener('click', () => {
            alert('成功消息：操作已完成');
        });

        document.getElementById('errorBtn').addEventListener('click', () => {
            alert('错误消息：操作失败');
        });

        document.getElementById('warningBtn').addEventListener('click', () => {
            alert('警告消息：请注意');
        });

        document.getElementById('loadingBtn').addEventListener('click', () => {
            alert('加载中...');
        });

        document.getElementById('multiBtn').addEventListener('click', () => {
            alert('消息1\n消息2\n消息3');
        });
    </script>

    <style>
        .demo-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .demo-item {
            background: var(--bg-light);
            padding: 16px;
            border-radius: 8px;
            text-align: center;
        }

        .demo-item h3 {
            margin-top: 0;
            margin-bottom: 16px;
            font-size: 14px;
            color: var(--text-primary);
        }

        .demo-btn {
            padding: 8px 16px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
            transition: var(--transition);
        }

        .demo-btn:hover {
            opacity: 0.8;
        }
    </style>
</body>
</html>
